package com.lihan.GetSeatInLib.Repository;

import java.util.List;
import java.util.Set;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import com.lihan.GetSeatInLib.Domain.Order;
import com.lihan.GetSeatInLib.Domain.User;

@Repository
public interface OrderRepository extends JpaRepository<Order, Long>{

	//查找一个指定用户的所有订单
	@Query("from Order where owner = ?0")
	List<Order> QueryOrderByUser(User user);
	
	@Query("from Order where status = 2")
	List<Order> QueryUsedOrders();
}
